package com.hcms.admin.dto;

import cn.hutool.core.bean.BeanUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hcms.common.util.TreeNode;
import com.hcms.mybatis.entity.CmsCate;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CmsCateTreeResponse implements Serializable, TreeNode<CmsCateTreeResponse, Long> {

    private Long id;

    private String cateName;

    private String enName;

    private String cateFolder;

    private Long parentId;

    private Long moduleId;

    private String url;

    private String image;

    private String icoImage;

    private String title;

    private String keywords;

    private String description;

    private String summary;

    private String templateList;

    private String templateShow;

    private Integer pageSize;

    private Integer isMenu;

    private Integer isNext;

    private Integer isBlank;

    private Integer sort;

    private Integer status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date updateTime;

    private List<CmsCateTreeResponse> children;

    public CmsCateTreeResponse(CmsCate cate) {
        BeanUtil.copyProperties(cate, this);
    }

}
